<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class BindingPhoneNum extends CI_Controller {

	public function index()
	{
		# code...
		$json = $this->ci_wechat->getOauthAccessToken();
		if($json) {
			// echo json_encode($json, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
			$this->load->view('binding_phone_num', $json);
			return;
		}
		$callback = current_url();
		$state = 'wxbase';
		$scope = 'snsapi_base';
		$oauth_url = $this->ci_wechat->getOauthRedirect($callback,$state,$scope);
		redirect($oauth_url);
	}
}
